<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../../Templates/SubFolderTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content">
        <p:panel id="panel" header="View Product Prices">
            <p:tabView style="display: inline-block; width: 99%;">
                <p:tab title="Nuts">
                    <h:form>
                        <p:dataTable var="product" value="#{viewProductPriceManagerBean.productPriceA}" 
                                     dynamic="true" paginator="true" rows="5" emptyMessage="No product found in database." selection="#{viewProductPriceManagerBean.selectedProductPrice}">             
                                <p:column selectionMode="single" />


                                <p:column sortBy="#{product.lowerLimit}" filterBy="#{product.lowerLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Lower Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.lowerLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.higherLimit}" filterBy="#{product.higherLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Higher Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.higherLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.productPrice}" filterBy="#{product.productPrice}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Product Price" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.productPrice}" /> 
                                </p:column> 

                                <f:facet name="footer">  
                                    <p:commandButton value="Edit" image="ui-icon ui-icon-pencil" actionListener="#{viewProductPriceManagerBean.editProductPrice(event)}"/>                             
                                    <p:commandButton value="Delete" image="ui-icon ui-icon-trash" onclick="productDeleteDialog.show()">
                                        <f:setPropertyActionListener value="#{product}" target="#{viewProductPriceManagerBean.selectedProductPrice}"/>
                                    </p:commandButton>
                                </f:facet>
                        </p:dataTable>


                        <p:confirmDialog message="Are you sure to delete the product?"  
                    showEffect="clip" hideEffect="fold" 
                    header="Initiating delete process" severity="alert" widgetVar="productDeleteDialog">  

                            <p:commandButton value="Yes" update="messages" oncomplete= "productDeleteDialog.hide()"  
                                             actionListener="#{viewProductPriceManagerBean.deleteProductPrice(event)}" />  
                            <p:commandButton value="No" onclick="productDeleteDialog.hide()" type="button" />  
                        </p:confirmDialog>
                    </h:form>
                </p:tab>

                <p:tab title="Fruits">
                    <h:form>
                        <p:dataTable var="product" value="#{viewProductPriceManagerBean.productPriceB}" 
                                     dynamic="true" paginator="true" rows="5" emptyMessage="No product found in database." selection="#{viewProductPriceManagerBean.selectedProductPrice}">             
                                <p:column selectionMode="single" />


                                <p:column sortBy="#{product.lowerLimit}" filterBy="#{product.lowerLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Lower Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.lowerLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.higherLimit}" filterBy="#{product.higherLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Higher Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.higherLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.productPrice}" filterBy="#{product.productPrice}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Product Price" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.productPrice}" /> 
                                </p:column> 

                                <f:facet name="footer">  
                                    <p:commandButton value="Edit" image="ui-icon ui-icon-pencil" actionListener="#{viewProductPriceManagerBean.editProductPrice(event)}"/>                             
                                    <p:commandButton value="Delete" image="ui-icon ui-icon-trash" onclick="productDeleteDialog.show()">
                                        <f:setPropertyActionListener value="#{product}" target="#{viewProductPriceManagerBean.selectedProductPrice}"/>
                                    </p:commandButton>
                                </f:facet>
                        </p:dataTable>


                        <p:confirmDialog message="Are you sure to delete the product?"  
                    showEffect="clip" hideEffect="fold" 
                    header="Initiating delete process" severity="alert" widgetVar="productDeleteDialog">  

                            <p:commandButton value="Yes" update="messages" oncomplete= "productDeleteDialog.hide()"  
                                             actionListener="#{viewProductPriceManagerBean.deleteProductPrice(event)}" />  
                            <p:commandButton value="No" onclick="productDeleteDialog.hide()" type="button" />  
                        </p:confirmDialog>
                    </h:form>
                </p:tab>

                <p:tab title="Chocolate Nuts">
                    <h:form>
                        <p:dataTable var="product" value="#{viewProductPriceManagerBean.productPriceC}" 
                                     dynamic="true" paginator="true" rows="5" emptyMessage="No product found in database." selection="#{viewProductPriceManagerBean.selectedProductPrice}">             
                                <p:column selectionMode="single" />



                                <p:column sortBy="#{product.lowerLimit}" filterBy="#{product.lowerLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Lower Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.lowerLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.higherLimit}" filterBy="#{product.higherLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Higher Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.higherLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.productPrice}" filterBy="#{product.productPrice}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Product Price" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.productPrice}" /> 
                                </p:column> 

                                <f:facet name="footer">  
                                    <p:commandButton value="Edit" image="ui-icon ui-icon-pencil" actionListener="#{viewProductPriceManagerBean.editProductPrice(event)}"/>                             
                                    <p:commandButton value="Delete" image="ui-icon ui-icon-trash" onclick="productDeleteDialog.show()">
                                        <f:setPropertyActionListener value="#{product}" target="#{viewProductPriceManagerBean.selectedProductPrice}"/>
                                    </p:commandButton>
                                </f:facet>
                        </p:dataTable>


                        <p:confirmDialog message="Are you sure to delete the product?"  
                    showEffect="clip" hideEffect="fold" 
                    header="Initiating delete process" severity="alert" widgetVar="productDeleteDialog">  

                            <p:commandButton value="Yes" update="messages" oncomplete= "productDeleteDialog.hide()"  
                                             actionListener="#{viewProductPriceManagerBean.deleteProductPrice(event)}" />  
                            <p:commandButton value="No" onclick="productDeleteDialog.hide()" type="button" />  
                        </p:confirmDialog>
                    </h:form>
                </p:tab>

                <p:tab title="Redcurrant Fruits">
                    <h:form>
                        <p:dataTable var="product" value="#{viewProductPriceManagerBean.productPriceD}" 
                                     dynamic="true" paginator="true" rows="5" emptyMessage="No product found in database." selection="#{viewProductPriceManagerBean.selectedProductPrice}">             
                                <p:column selectionMode="single" />

   

                                <p:column sortBy="#{product.lowerLimit}" filterBy="#{product.lowerLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Lower Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.lowerLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.higherLimit}" filterBy="#{product.higherLimit}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Higher Limit" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.higherLimit}" /> 
                                </p:column> 

                                <p:column sortBy="#{product.productPrice}" filterBy="#{product.productPrice}"> 
                                    <f:facet name="header"> 
                                        <h:outputText value="Product Price" /> 
                                    </f:facet> 
                                    <h:outputText value="#{product.productPrice}" /> 
                                </p:column> 

                                <f:facet name="footer">  
                                    <p:commandButton value="Edit" image="ui-icon ui-icon-pencil" actionListener="#{viewProductPriceManagerBean.editProductPrice(event)}"/>                             
                                    <p:commandButton value="Delete" image="ui-icon ui-icon-trash" onclick="productDeleteDialog.show()">
                                        <f:setPropertyActionListener value="#{product}" target="#{viewProductPriceManagerBean.selectedProductPrice}"/>
                                    </p:commandButton>
                                </f:facet>
                        </p:dataTable>


                        <p:confirmDialog message="Are you sure to delete the product?"  
                    showEffect="clip" hideEffect="fold" 
                    header="Initiating delete process" severity="alert" widgetVar="productDeleteDialog">  

                            <p:commandButton value="Yes" update="messages" oncomplete= "productDeleteDialog.hide()"  
                                             actionListener="#{viewProductPriceManagerBean.deleteProductPrice(event)}" />  
                            <p:commandButton value="No" onclick="productDeleteDialog.hide()" type="button" />  
                        </p:confirmDialog>
                    </h:form>
                </p:tab>
            </p:tabView>
        </p:panel>
    </ui:define>

</ui:composition>


